package com.airclick.merchant.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * @author caiwangjue
 * @date 8/10/21 3:23 PM
 */


@Data
@MappedSuperclass
public class BaseEntity {

    /**
     * 创建时间
     */
    @Column(name="gmt_create", nullable = false, updatable = false, columnDefinition = "datetime COMMENT '创建时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @org.hibernate.annotations.CreationTimestamp
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @Column(name="gmt_modify", nullable = true, columnDefinition = "datetime COMMENT '修改时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @org.hibernate.annotations.UpdateTimestamp
    private Date gmtModify;

    @Transient
    private String gmtCreateStr;

    @Transient
    private String gmtModifyStr;

    @Column(name="creator", nullable = false, length = 100, columnDefinition = "varchar(100) COMMENT '创建者'")
    @ApiModelProperty("创建者")
    private String creator;

    @Column(name="modifier", nullable = true, length = 100, columnDefinition = "varchar(100) COMMENT '修改者'")
    @ApiModelProperty("修改者")
    private String modifier;
}
